Skip to content

Recommend disabling Nagle's algorithm on the MQTT server - #173

Merged
tpanajott merged 1 commit into
NSPManager:mainfrom
jamesmulcahy:docs/mqtt-tcp-nodelay
Nov 7, 2026
Merged

tpanajott merged 1 commit into
NSPManager:mainfrom
jamesmulcahy:docs/mqtt-tcp-nodelay

Conversation

@jamesmulcahy

Copy link
Copy Markdown
Contributor

Adds a tip to Getting started → Pre-requisites recommending that Nagle's algorithm be turned off on the MQTT server, and how to do it in Mosquitto (set_tcp_nodelay true, 2.0+).

Why

Nearly every MQTT message between the manager and the panels is small. With Nagle's algorithm on, TCP holds a small packet back until the data sent before it has been acknowledged, and the other side delays its ACKs, so small messages can wait tens to hundreds of milliseconds.

Measured on one panel switching rooms. The time is from the panel subscribing to a room or entities-page topic until the broker's retained value arrives:

Room state Entities page Worst case
Nagle on at both ends ~50 ms ~55 ms 150–300 ms, often
Off on the panel only (NSPManager/NSPanelManager-firmware#59) ~22 ms ~45 ms 100–240 ms spikes remain
Off on the panel and the broker ~22 ms ~45 ms 134 ms, none over 200 ms

The panel side is handled in the firmware (NSPManager/NSPanelManager-firmware#59). The broker side is a setting users have to change themselves, hence this tip.

Notes

  • It doesn't recommend Mosquitto specifically, only how to make the change if you use it.
  • It says the option needs Mosquitto 2.0 or newer: 1.x doesn't recognise set_tcp_nodelay and refuses to start.
  • CI on this repo builds the site and checks links, and PushPreview posts a rendered preview of the change.

🤖 Generated with Claude Code

Most MQTT messages between the manager and the panels are small, and with
Nagle's algorithm on, the broker holds each one back until the data before it
has been acknowledged. On a real panel this delayed the replies to the
subscriptions made when switching rooms by up to ~240 ms. Add a tip to the
pre-requisites page recommending turning it off, and how to do it in
Mosquitto (set_tcp_nodelay, 2.0+). The panel side is handled in the firmware
(NSPManager/NSPanelManager-firmware#59).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tpanajott
tpanajott merged commit 5c2d70a into NSPManager:main Nov 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants